<!-- 资源配置 -->
<template>
  <div class="disFlx">
    <TableMenu
      class="br-10"
      title="资源配置"
      :selectKey="menuKey"
      :menuList="menuList"
      @change="key => (menuKey = key)"
    />
    <div style="width: calc(100% - 160px)">
      <PnrResourceAllocation v-if="menuKey === 'connection'" />
      <ActivityResource v-if="menuKey === 'activity'" />
      <MallResourceAllocation v-if="menuKey === 'mall'" />
      <OpConfig v-if="menuKey === 'opConfig'" />
    </div>
  </div>
</template>

<script>
import TableMenu from '@/components/TableMenu'
import PnrResourceAllocation from './components/pnrResourceAllocation.vue'
import MallResourceAllocation from './components/mallResourceAllocation.vue'
import ActivityResource from './components/activityResource/index.vue'
import { getOpenMall } from '@/api/common'
import OpConfig from './components/opConfig.vue'
export default {
  components: {
    TableMenu,
    PnrResourceAllocation,
    MallResourceAllocation,
    ActivityResource,
    OpConfig
  },
  data() {
    return {
      menuList: [
        {
          name: '人脉资源配置',
          key: 'connection'
        },
        {
          name: '活动资源',
          key: 'activity'
        }
      ],
      menuKey: 'connection'
    }
  },
  computed: {},
  watch: {},
  methods: {},
  created() {
    getOpenMall().then(({ code, data }) => {
      if (code === 0 && data) {
        this.menuList.push({
          name: '资源平台',
          key: 'mall'
        })
      }
    })
  },
  mounted() {
    this.menuList.push({
      name: '供需配置',
      key: 'opConfig'
    })
  }
}
</script>
<style scoped></style>
